<%--
  Created by IntelliJ IDEA.
  User: 好好帅帅
  Date: 2024/10/20
  Time: 14:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>部门列表</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body>
<h2>部门列表</h2>
<a href="${pageContext.request.contextPath}/dept?action=add">添加部门</a>
<table class="layui-table">
    <thead>
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>职位</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="dept" items="${depts}">
        <tr>
            <td>${dept.id}</td>
            <td>${dept.name}</td>
            <td>${dept.position}</td>
            <td>
                <a href="${pageContext.request.contextPath}/dept?action=toupdate&id=${dept.id}">修改</a>
                <a href="${pageContext.request.contextPath}/dept?action=delete&id=${dept.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>